﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernate;
using FluentNHibernate.Data;

namespace BankCreditPortfolio.DAL.Entities
{
    public class Payments
    {
        public virtual int PaymentsId { get; set; }
        public virtual Credit Credit { get; set; }
        public virtual Payment Payment { get; set; }
    }

    public class PaymentsMap : ClassMap<Payments>
    {
        public PaymentsMap()
        {
            Id(x => x.PaymentsId).GeneratedBy.HiLo("payments");
            Id(x => x.PaymentsId).Unique();
            References(x => x.Credit).Column("CreditId");
            References(x => x.Payment).Column("PaymentId");
            Table("Payments");
        }
    }
}
